home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Internet / News / Alexandra.0.82 / Source / Interval.m < prev    next >
Encoding:
Text File  |  1996-01-30  |  593 b   |  44 lines

  1.  
  2. #import "Interval.h"
  3.  
  4. @implementation Interval
  5. - (BOOL)isIn:(unsigned long)number
  6. {
  7.    if((number>=from) && (number<=to))
  8.       return TRUE;
  9.    else
  10.       return FALSE;
  11. }
  12.  
  13. - (unsigned long)lowerBound
  14. {
  15.    return from;
  16. }
  17.  
  18. - (unsigned long)upperBound
  19. {
  20.    return to;
  21. }
  22.  
  23. - initWithLower:(unsigned long)low upper:(unsigned long)high
  24. {
  25.    [self init];
  26.    from=low;
  27.    to=high;
  28.    return self;
  29. }
  30.  
  31. - dumpAsAsciiIn:(NXStream *)aStream;
  32. {
  33.  
  34.    if(from<to)
  35.       NXPrintf(aStream,"%d-%d",from,to);
  36.    else if(from==to)
  37.       NXPrintf(aStream,"%d",from);
  38.    return self;
  39. }
  40.                        
  41.  
  42.  
  43. @end
  44.